﻿using System;
using System.Web.Services;
using Monkey.Warrenty.Biz;
using Monkey.Warrenty.EntityModel;

namespace MonkeyWarranty.Web.Products
{
    public partial class Groups : System.Web.UI.Page
    {
        #region Properties

        private static ProductGroupBiz _productGroupBiz;
        private static ProductGroupBiz ProductGroupManager
        {
            get { return _productGroupBiz ?? (_productGroupBiz = new ProductGroupBiz()); }
        }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [WebMethod(EnableSession = true)]
        public static object GroupList()
        {
            return ProductGroupManager.GetAllProductGroupsWs();
        }

        [WebMethod(EnableSession = true)]
        public static object CreateGroup(ProductGroup record)
        {
            return ProductGroupManager.CreateGroupWs(record);
        }

        [WebMethod(EnableSession = true)]
        public static object UpdateGroup(ProductGroup record)
        {
            return ProductGroupManager.UpdateGroupWs(record);
        }

        [WebMethod(EnableSession = true)]
        public static object DeleteGroup(int Id)
        {
            return ProductGroupManager.DeleteGroupWs(Id);
        }
    }
}